﻿using System;
namespace Kis.Xroad.Eu {
    
    
    [System.SerializableAttribute()]
    public class DerivedSimpleListType : global::Kis.Xroad.Eu.SimpleListType {
        
        public const string LARGESMALL = "large small";
        
        public DerivedSimpleListType(string value) : 
                base(value) {
            this.Validate();
            string annot = null;
            if (value.ToString() == "large small") {
                annot = "large small";
            }
            if (annot!=null) {
                this._annotation = annot;
            }
            else {
                throw new global::Xtee.Core.Types.XteeSimpleTypeValidationException(string.Format("Enumeration on [{0}] does not allow value : [{1}] ", this.GetType().Name,value.ToString()));;
            }
        }
        
        public DerivedSimpleListType() : 
                base(new System.Collections.Generic.List<global::Kis.Xroad.Eu.SizeType>()) {
        }
        
        public DerivedSimpleListType(System.Collections.Generic.IList<global::Kis.Xroad.Eu.SizeType> value) : 
                base(value) {
            this.Validate();
            string annot = null;
            if (ToString() == "large small") {
                annot = "large small";
            }
            if (annot!=null) {
                this._annotation = annot;
            }
            else {
                throw new global::Xtee.Core.Types.XteeSimpleTypeValidationException(string.Format("Enumeration on [{0}] does not allow value : [{1}] ", this.GetType().Name,ToString()));;
            }
        }
        
        public static bool TryParse(string value, out global::Kis.Xroad.Eu.DerivedSimpleListType result) {
            try {
                result = new global::Kis.Xroad.Eu.DerivedSimpleListType(value);
                return true;
            }
            catch (System.Exception ) {
                result = null;
                return false;
            }
        }
        
        public static global::Kis.Xroad.Eu.DerivedSimpleListType Parse(string value) {
            global::Kis.Xroad.Eu.DerivedSimpleListType _DerivedSimpleListType = null;
            if (global::Kis.Xroad.Eu.DerivedSimpleListType.TryParse(value,out _DerivedSimpleListType)) {
                return new DerivedSimpleListType(_DerivedSimpleListType);
            }
             throw new FormatException("Cannot parse to type [global::Kis.Xroad.Eu.DerivedSimpleListType] from string value : [" + value + "]");;
        }
        
        public override global::Kis.Xroad.Eu.SizeType ParseElement(string value) {
            return new global::Kis.Xroad.Eu.SizeType(value);
        }
    }
}
